﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Acoris.Markdown
{
    /// <summary>
    /// 表示
    /// </summary>
    public sealed class AcToken
    {
        private int                         m_startLine;
        private int                         m_endLine;
        private int                         m_startPosition;
        private int                         m_endPosition;
        private AcorisMLContract.Type       m_type;
        private AcToken                     m_parent;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="type"></param>
        /// <param name="startLine"></param>
        /// <param name="endLine"></param>
        /// <param name="startPosition"></param>
        /// <param name="EndPosition"></param>
        /// <param name="parent"></param>
        internal AcToken(AcorisMLContract.Type type, int startLine, int endLine, int startPosition, int EndPosition, AcToken parent)
        {
            m_type = type;
            m_startLine = startLine;
            m_endLine = endLine;
            m_startPosition = startPosition;
            m_endPosition = EndPosition;
            m_parent = parent;
        }

        /// <summary>
        /// 获取或设置开始行数
        /// </summary>
        public int StartLine {
            get {
                return m_startLine;
            }
            set {
                m_startLine = value;
            }
        }

        /// <summary>
        /// 获取或设置结束行数
        /// </summary>
        public int EndLine {
            get {
                return m_endLine;
            }
            set {
                m_endLine = value;
            }
        }

        /// <summary>
        /// 获取或设置开始位置
        /// </summary>
        public int StartPosition {
            get {
                return m_startPosition;
            }
            set {
                m_startPosition = value;
            }
        }

        /// <summary>
        /// 获取或设置结束位置
        /// </summary>
        public int EndPosition {
            get {
                return m_endPosition;
            }
            set {
                m_endPosition = value;
            }
        }

        /// <summary>
        /// 获取或设置当前记号的父级信息
        /// </summary>
        public AcToken Parent {
            get {
                return m_parent;
            }
            set {
                m_parent = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        internal AcorisMLContract.Type Type {
            get {
                return m_type;
            }
            set {
                m_type = value;
            }
        }
    }
}
